{extend name="Master/base" /} {block name="title"}后台主页{/block} {block name="main"}

<section class="content-header">
    <h1>
        项目周报管理
    </h1>
    <ol class="breadcrumb">

    </ol>
</section>

<section class="content">
    <div class="row">
        <div class="box box-success">
            <div class="box-header with-border">
                <h3 class="box-title">
                    {if condition="empty($project_id)"} 项目周报 {else/} {$project.title} {/if} -周报
                </h3>
            </div>
            <form role="form" class="validator_form" action="{:url('/Index/Project/ProjectWeekly/add')}" id="addProjectWeeklyForm" method="post">
                <input type="hidden" name="id" value="{$info.id?=$info.id}">
                <div class="box-body">
                    <div style="height: 600px;">
                        {if condition="empty($project_id)"}
                        <div class="form-group">
                            <label>选择项目</label>
                            <select name="project_id" class="form-control" required>
                                <option value="">
                                    选择项目
                                    </option>
                            {volist name="project" id="p_item"}
                            <option value="{$p_item['id']}">
                                {$p_item["title"]}
                            </option>
                            {/volist}
                     </select>
                        </div>
                        {else/}
                        <input type="hidden" name="project_id" value="{$project_id}">
                        <!--11-->
                        {/if}

                        <div class="form-group">
                            <div class="col-md-6">
                                <label>项目名称</label>
                                <input type="text" class="form-control" disabled="disabled" value="{$project.title?=$project.title}">
                            </div>
                            <div class="col-md-6">
                                <label>项目编号</label>
                                <input type="text" class="form-control" disabled="disabled" value="{$project.project_no?=$project.project_no}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-6">
                                <label>项目经理</label>
                                <input type="text" class="form-control" disabled="disabled" value="{$pm_info.nickname?=$pm_info.nickname}">
                            </div>
                            <div class="col-md-6">
                                <label>项目工期</label>
                                <input type="text" class="form-control" disabled="disabled" value="{$project.day?=$project.day.'天'}">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-6">
                                <label><i class="text-red">*</i> 项目概况</label>
                                <textarea name="weekly_info" id="weekly_info" required style="width: 100%; height: 150px">
                                    {$week_info.weekly_info?=$week_info.weekly_info}
                                    
                                </textarea>
                            </div>
                            <div class="col-md-6">
                                <label>项目组成员</label>
                                <div class="box-body no-padding ">
                                    <ul class="nav nav-pills nav-stacked ">
                                        <!--active-->
                                        <li>

                                            <span>固定现有成员</span>

                                            <input type="text" class="form-control" disabled="disabled" value="{$team_name}">

                                        </li>
                                        <li>
                                            <span>机动人员</span>
                                            <input type="text" class="form-control" name="jidong">
                                        </li>
                                        <li>
                                            <span>外包人员</span>
                                            <input type="text" class="form-control" name="outsourcing">
                                        </li>

                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-6">
                                <label>周报当月周数</label>
                                <select class="form-control" name="weeks">
                                        {for start="1" end="$week_day+1"}
                                        <option value="{$i}" {:monthWeek()==$i?'selected="selected"':''} >第{$i}周</option>
                                        {/for}
                                
                               </select>
                            </div>

                            <div class="col-md-6">
                                <label>项目所在阶段</label>
                                <div class="box-body no-padding ">
                                    <ul class="nav nav-pills nav-stacked ">
                                        <!--active-->
                                        <li>

                                            <input type="checkbox"><span>合同未签已进场</span>
                                        </li>
                                        <li>

                                            <input type="checkbox"><span>合同未签已进场</span>
                                        </li>
                                        <li>

                                            <input type="checkbox"><span>合同未签已进场</span>
                                        </li>

                                    </ul>

                                </div>
                            </div>
                        </div>
                    </div>



                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title"><i class="text-red">*</i> 财务信息（单位：元）</h3>
                        </div>

                        <div class="form-group">
                            <textarea name="finance" id="finance" class="editor_content " style="width: 100%; height: 100px">
                                {$week_info.finance?=$week_info.finance}
                            </textarea>
                        </div>

                    </div>


                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title">工作进展汇报（本周工作内容及下周工作计划）</h3>
                        </div>
                        <div class="box-body">
                            <div class="form-group">
                                <label><i class="text-red">*</i> 项目进展</label>
                                <textarea name="project_progress" id="project_progress" style="width: 100%; height: 150px">
                                    {$week_info.project_progress?=$week_info.project_progress}
                                </textarea>
                            </div>

                            <div class="form-group">
                                <label><i class="text-red">*</i> 下周计划</label>
                                <textarea name="week_work" id="week_work" style="width: 100%; height: 150px">
                                        {$week_info.week_work?=$week_info.week_work}
                                </textarea>
                            </div>

                            <div class="form-group">
                                <label><i class="text-red">*</i> 质量风险管控</label>
                                <textarea name="quality_control" id="quality_control" style="width: 100%; height: 150px">
                                    {$week_info.quality_control?=$week_info.quality_control}
                                </textarea>
                            </div>
                            <div class="form-group">
                                <label>客户关注</label>
                                <textarea name="customer" id="customer" style="width: 100%; height: 150px">
                                    {$week_info.customer?=$week_info.customer}
                                </textarea>
                            </div>
                        </div>
                    </div>


                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title">烽火自有产品管理（如有）</h3>
                            <div class="box-tools">
                                <div class="input-group input-group-sm" style="width: 150px;">

                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-info" id="btn_product_add"><i class="fa fa-plus-square"></i> 新增产品</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="box-body">

                            <div class="form-group">

                                <table class="table table-hover ">
                                    <thead>
                                        <tr>
                                            <th><i class="text-red">*</i> 自有产品系统名称</th>

                                            <th><i class="text-red">*</i> 供应商</th>

                                            <th><i class="text-red">*</i> 采购金额（万元）</th>

                                            <th><i class="text-red">*</i> 采购到货金额（万元）</th>

                                            <th>业务协同要求</th>

                                            <th>问题描述</th>

                                            <th>建议及解决期限</th>
                                            <th>操作</th>
                                        </tr>

                                    </thead>
                                    <tbody id="product_body">
                                        {if condition="!empty($week_product)"}
                                        <!--11-->
                                        {volist name="week_product" id="vo" key="key"}
                                        <tr data-id="11">
                                            <td><input type="text" name="product_info[title][]" class="form-control " placeholder="自有产品系统名称" value="{$vo.title?=$vo.title}"> </td>

                                            <td><input type="text" name="product_info[provider][]" class="form-control" placeholder="供应商" value="{$vo.title?=$vo.title}"></td>

                                            <td><input type="text" name="product_info[price][]" class="form-control" data-bv-numeric="true" placeholder="采购金额（万元）" value="{$vo.price?=$vo.price}"></td>

                                            <td><input type="text" name="product_info[purch_price][]" class="form-control" data-bv-numeric="true" placeholder="采购到货金额（万元）" value="{$vo.purch_price?=$vo.purch_price}"></td>

                                            <td><input type="text" name="product_info[business][]" class="form-control" placeholder="业务协同要求" value="{$vo.business?=$vo.business}"></td>

                                            <td><input type="text" name="product_info[description][]" class="form-control" placeholder="问题描述" value="{$vo.description?=$vo.description}"></td>

                                            <td><input type="text" name="product_info[resolve][]" class="form-control" placeholder="建议及解决期限" value="{$vo.resolve?=$vo.resolve}"></td>
                                            <td><a class="btn label-danger product_del">删除</a></td>
                                        </tr>
                                        {/volist} {/if}
                                    </tbody>

                                </table>
                            </div>

                            <div class="form-group">
                                <label>自有产品进度描述</label>
                                <textarea name="product" id="product" style="width: 100%; height: 150px">
                                        {$week_info.product?=$week_info.product}
                                </textarea>
                            </div>
                        </div>
                    </div>


                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title">项目供应商及外包资源管理(如有)</h3>
                        </div>
                        <div class="box-body">
                            <div class="form-group">
                                <textarea name="supplier" id="supplier" style="width: 100%; height: 150px">
                                    {$week_info.supplier?=$week_info.supplier}
                                </textarea>
                            </div>
                        </div>
                    </div>

                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title">项目资源保障（包含协作与支持）</h3>
                        </div>
                        <div class="box-body">
                            <div class="form-group">
                                <textarea name="resource" id="resource" style="width: 100%; height: 150px">
                                    {$week_info.resource?=$week_info.resource}
                                </textarea>
                            </div>
                        </div>
                    </div>
                    {if condition="!empty($show_month)"}
                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title">月报</h3>
                        </div>
                        <div class="box-body">
                            <div class="form-group">
                                <textarea name="month_content" id="month_content" style="width: 100%; height: 150px">
                                
                                </textarea>
                            </div>
                        </div>
                    </div>
                    {/if}


                </div>
                <div class="box-footer">
                    <button type="submit" class="btn btn-primary">确认</button>
                </div>



            </form>
            <!-- /.box-body -->
        </div>
    </div>
</section>
{/block}
<!--script-->
{block name="script"}
<script id="tplContent" type="text/html">
    <tr>
        <td><input type="text" name="product_info[title][]" class="form-control" placeholder="自有产品系统名称"> </td>

        <td><input type="text" name="product_info[provider][]" class="form-control" placeholder="供应商"></td>

        <td><input type="text" name="product_info[price][]" class="form-control" data-bv-numeric="true" placeholder="采购金额（万元）"></td>

        <td><input type="text" name="product_info[purch_price][]" class="form-control" data-bv-numeric="true" placeholder="采购到货金额（万元）"></td>

        <td><input type="text" name="product_info[business][]" class="form-control" placeholder="业务协同要求"></td>

        <td><input type="text" name="product_info[description][]" class="form-control" placeholder="问题描述"></td>

        <td><input type="text" name="product_info[resolve][]" class="form-control" placeholder="建议及解决期限"></td>
        <td><a class="btn label-danger product_del">删除</a></td>
    </tr>
</script>
<script>
    $(function() {
        $("#btn_product_add").click(function() {
            var content = document.getElementById('tplContent').innerHTML;
            var result = miniTpl(content);
            $("#product_body").append(result);
            $(".product_del").click(function() {
                var obj = $(this);
                obj.parent("td").parent("tr").remove();
                // console.log(obj.parent("td").parent("tr").attr("data-id"));
            });
        });

        $(".product_del").click(function() {
            var obj = $(this);
            obj.parent("td").parent("tr").remove();
            // console.log(obj.parent("td").parent("tr").attr("data-id"));
        });
    });



    //实例化编辑器
    var ue1 = UE.getEditor('weekly_info');
    //实例化编辑器
    var ue2 = UE.getEditor('finance');
    //实例化编辑器
    var ue3 = UE.getEditor('project_progress');
    var ue9 = UE.getEditor('customer');

    //实例化编辑器
    var ue4 = UE.getEditor('week_work');
    var ue5 = UE.getEditor('quality_control');
    var ue6 = UE.getEditor('product');
    var ue7 = UE.getEditor('supplier');
    var ue8 = UE.getEditor('resource');
    UE.getEditor('month_content');
</script>
{/block}